import Vue from '../modules/vue'

const vm = new Vue({
  data(){
    return{
      a: 1,
      b: 3
    }
  },
  computed: {
    total() {
      console.log('computed')
      return this.a + this.b
    }
  },

  watch:{
    total (newValue, oldValue){
      console.log('total',newValue, oldValue)
    },
    a(newValue,oldValue){
      console.log('a',newValue, oldValue)
    },
    b(newValue,oldValue){
      console.log('b',newValue, oldValue)
    },
  }
})

console.log(vm)

console.log(vm.total)
console.log(vm.total)
console.log(vm.total)

vm.a = 100

console.log(vm.total)
console.log(vm.total)
console.log(vm.total)

vm.b = 200
console.log(vm.total)
console.log(vm.total)
console.log(vm.total)
